package cn.com.chengmandian.bike.controller;


import cn.com.chengmandian.bike.model.EbQuestionInfo;
import cn.com.chengmandian.bike.service.IEbQuestionInfoService;
import cn.com.chengmandian.core.common.constants.CommonConstant;
import cn.com.chengmandian.core.web.pojo.AjaxResult;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 常见问题 前端控制器
 * </p>
 *
 * @author AutoGenerator
 * @since 2021-12-20
 */
@Api(tags = "常见问题")
@RestController
@RequestMapping("/question/info")
public class EbQuestionInfoController {

    @Autowired
    private IEbQuestionInfoService iEbQuestionInfoService;

    @ApiOperation("常见问题-列表(无需登录)")
    @GetMapping("/list")
    public AjaxResult allData(){
        return AjaxResult.success(iEbQuestionInfoService.list(new LambdaQueryWrapper<EbQuestionInfo >()
        .eq(EbQuestionInfo::getIsDeleted,CommonConstant.ZERO)
        .eq(EbQuestionInfo::getIsEnabled,CommonConstant.ONE)
                .orderByAsc(EbQuestionInfo::getSort)));
    }
}
